from fastapi import FastAPI
from flask import Flask
from flask_cors import CORS

from backend import pdf

app = Flask(__name__, static_folder='static', template_folder='templates')
# 允许跨域传输数据
CORS(app)




# 注册 Blueprint
app.register_blueprint(pdf.nw_pdf_blueprint, url_prefix='/nw_pdf')

@app.get("/")
async def root():
    return {"message": "Hello World"}


@app.get("/hello/{name}")
async def say_hello(name: str):
    return {"message": f"Hello {name}"}



if __name__ == '__main__':
    app.run(host='0.0.0.0',port=5000)
